from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, TextAreaField
from ....models.tag import Tag
from . import Unique


class EditForm(FlaskForm):
    tag_name = StringField('标签名称', validators=[
        Unique(model=Tag, model_field=Tag.tag_name, message='已存在的TAG')
    ])
    tag_title = StringField('标签标题')
    tag_keyword = StringField('关键词')
    tag_description = TextAreaField('描述')
    save = SubmitField('保存')


class GoodForm(FlaskForm):
    confirm_good = SubmitField('推荐')
    cancel_good = SubmitField('取消推荐')